// vue.config.js
const path = require("path");
module.exports = {
  publicPath: process.env.VUE_APP_PABLICPATH,
  chainWebpack: config => {
    config.plugin("define").tap(args => {
      args[0]["process.env"].RELEASE_ENV = JSON.stringify(
        process.env.RELEASE_ENV
      );
      return args;
    });
    config.plugin("html").tap(args => {
      args[0].title = "风控压力测试系统";
      return args;
    });
  },
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "scss",
      patterns: [path.resolve(__dirname, "./src/assets/css/variable.scss")]
    }
  },
  devServer: {
    port: 9527,
    proxy: {
      "/api": {
        target: "http://39.100.203.75:8999",
        ws: true,
        changeOrigin: true,
        pathRewrite: {
           "^/api": "" // 路径重写
        }
      },
      "/foo": {
        target: "<other_url>"
      }
    }
  }
};
